/**
 * Author: luoqi
 * Created Date: 2025-11-11 23:20:35
 * Last Modified: 2025-11-11 23:57:47
 * Modified By: luoqi at <**@****>
 * Copyright (c) 2025 <*****>
 * Description:
 */

#include <bsp.h>
#include <io_port.h>
#include <stdbool.h>
#include "blink.h"

static void task_blink_hdl()
{
    static bool state = true;
    state = !state;
    if(state) {
        io_set(GPO_BLINK, IO_HIGH);
    } else {
        io_set(GPO_BLINK, IO_LOW);
    }
}

int blink_init()
{
    io_set(GPO_BLINK, IO_LOW);
    task_add("blink", task_blink_hdl, 1000);
    return 0;
}
